﻿<UserControl x:Class="Tareas.SharingPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    d:DesignWidth="646" d:DesignHeight="768">

    <UserControl.Resources>

        <!-- TODO: Delete this line if the key AppName is declared in App.xaml -->
        <x:String x:Key="ApplicationName">MetroTask</x:String>

        <Style x:Key="LayoutRootGridStyle" TargetType="Grid">
            <Setter Property="Background" Value="White"/>
        </Style>

        <!-- Temporary: Default Button Style will live elsewhere -->

        <FontFamily x:Key="SemiBoldContentFontFamily">Segoe UI</FontFamily>
        <SolidColorBrush x:Key="ControlHighlightColor" Color="#FF26A0DA"/>
        <SolidColorBrush x:Key="ControlTextColor" Color="White"/>
        <SolidColorBrush x:Key="ControlStrokeColor" Color="White"/>
        <Color x:Key="ControlPressedTextColor">#FF212121</Color>
        <Color x:Key="ControlDisabledTextColor">#7CFFFFFF</Color>
        <SolidColorBrush x:Key="ControlDisabledStrokeColor" Color="#7CFFFFFF"/>
        <SolidColorBrush x:Key="ControlDisabledFillColor" Color="Transparent"/>
        <SolidColorBrush x:Key="DeafultButtonControlMouseOverFillColor" Color="#E55AB7E3"/>
        <x:Double x:Key="ContentFontSize">14.667</x:Double>
        <Thickness x:Key="ControlBorderThickness">2</Thickness>
        <x:Double x:Key="ControlStrokeThickness">2</x:Double>
        <CornerRadius x:Key="ControlBorderRadius">0</CornerRadius>

        <Style x:Key="DefaultButtonStyle" TargetType="Button">
            <Setter Property="Background" Value="{StaticResource ControlHighlightColor}"/>
            <Setter Property="MinWidth" Value="96"/>
            <Setter Property="MaxWidth" Value="237"/>
            <Setter Property="MinHeight" Value="38"/>
            <Setter Property="Foreground" Value="{StaticResource ControlTextColor}"/>
            <Setter Property="FontFamily" Value="{StaticResource SemiBoldContentFontFamily}"/>
            <Setter Property="FontSize" Value="{StaticResource ContentFontSize}"/>
            <Setter Property="Padding" Value="12,3,12,5"/>
            <Setter Property="HorizontalAlignment" Value="Left"/>
            <Setter Property="VerticalAlignment" Value="Center"/>
            <Setter Property="BorderThickness" Value="{StaticResource ControlBorderThickness}"/>
            <Setter Property="BorderBrush" Value="{StaticResource ControlStrokeColor}"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Grid>
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Normal"/>
                                    <VisualState x:Name="MouseOver">
                                        <Storyboard>
                                            <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="MouseOverBorder" />
                                            <DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="Background" />
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Pressed">
                                        <Storyboard>
                                            <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="PressedBorder" />
                                            <DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="Background" />
                                            <ColorAnimation Duration="0" To="{StaticResource ControlPressedTextColor}" Storyboard.TargetProperty="(Control.Foreground).(SolidColorBrush.Color)" Storyboard.TargetName="contentControl"/>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Disabled">
                                        <Storyboard>
                                            <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="DisabledVisualElement"/>
                                            <DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="Background" />
                                            <ColorAnimation Duration="0" To="{StaticResource ControlDisabledTextColor}" Storyboard.TargetProperty="(Control.Foreground).(SolidColorBrush.Color)" Storyboard.TargetName="contentControl"/>
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="FocusStates">
                                    <VisualState x:Name="Focused">
                                        <Storyboard>
                                            <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="FocusVisualWhite" />
                                            <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="FocusVisualBlack"/>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Unfocused"/>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Grid Margin="3">
                                <Border x:Name="Background" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" CornerRadius="{StaticResource ControlBorderRadius}"/>
                                <Border x:Name="MouseOverBorder" BorderThickness="{TemplateBinding BorderThickness}" Background="{StaticResource DeafultButtonControlMouseOverFillColor}" CornerRadius="{StaticResource ControlBorderRadius}" Margin="0" Opacity="0" BorderBrush="{StaticResource ControlStrokeColor}"/>
                                <Border x:Name="PressedBorder" BorderThickness="{TemplateBinding BorderThickness}" Background="{StaticResource ControlTextColor}" CornerRadius="{StaticResource ControlBorderRadius}" Margin="0" Opacity="0" BorderBrush="{StaticResource ControlStrokeColor}"/>
                                <ContentControl x:Name="contentControl" Foreground="{TemplateBinding Foreground}" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                                <Rectangle x:Name="DisabledVisualElement" Fill="{StaticResource ControlDisabledFillColor}" IsHitTestVisible="false" Opacity="0" RadiusY="0" RadiusX="0" Stroke="{StaticResource ControlDisabledStrokeColor}" StrokeThickness="{StaticResource ControlStrokeThickness}"/>
                            </Grid>
                            <Rectangle x:Name="FocusVisualWhite" RadiusY="0" RadiusX="0" Stroke="White" Margin="0" StrokeEndLineCap="Square" StrokeDashArray="1,1" Opacity="0" StrokeDashOffset="1.5"/>
                            <Rectangle x:Name="FocusVisualBlack" RadiusY="0" RadiusX="0" Stroke="Black" Margin="0" StrokeEndLineCap="Square" StrokeDashArray="1,1" Opacity="0" StrokeDashOffset="0.5"/>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <!-- Standard Fonts -->

        <Style x:Key="DefaultFontStyle" TargetType="TextBlock">
            <Setter Property="Foreground" Value="White"/>
            <Setter Property="FontSize" Value="26.667"/>
            <Setter Property="FontFamily" Value="Segoe UI"/>
            <Setter Property="FontWeight" Value="Light"/>
            <Setter Property="Margin" Value="0,0,0,0"/>
            <Setter Property="TextTrimming" Value="WordEllipsis"/>
            <Setter Property="TextWrapping" Value="Wrap"/>
        </Style>

        <Style x:Key="ShareTitleFontStyle" TargetType="TextBlock" BasedOn="{StaticResource DefaultFontStyle}">
            <Setter Property="Foreground" Value="#2a2a2a"/>
        </Style>

        <Style x:Key="SmallContentFontStyle" TargetType="TextBlock" BasedOn="{StaticResource DefaultFontStyle}">
            <Setter Property="FontSize" Value="14.667"/>
            <Setter Property="Foreground" Value="#707070"/>
        </Style>
    </UserControl.Resources>

    <!-- Page Content -->

    <Grid x:Name="LayoutRoot" Style="{StaticResource LayoutRootGridStyle}">

        <Grid.RowDefinitions>
            <RowDefinition Height="80"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>

        <Grid Background="#D1D3D4">
            <TextBlock x:Name="PageName" Text="{StaticResource ApplicationName}" Style="{StaticResource ShareTitleFontStyle}" Margin="40,32,0,0" />

            <!-- Location for Application Logo -->

            <Grid Margin="14,34,40,16" HorizontalAlignment="Right" Background="DarkGray">
                <Image x:Name="Logo" Height="30" Width="30"/>
            </Grid>
        </Grid>

        <Grid Grid.Row="1" Margin="40,20,40,0">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>

            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>

                <StackPanel Grid.Column="1">
                    <TextBlock x:Name="ItemTitle" Style="{StaticResource ShareTitleFontStyle}" Text="Nueva Tarea" ></TextBlock>
                    <TextBlock x:Name="ItemDescription" Style="{StaticResource SmallContentFontStyle}" Text="Item Description"></TextBlock>
                    <TextBox x:Name="ItemDetails"></TextBox>
                </StackPanel>
            </Grid>

            <!-- Space for Additional Share UI -->
            <TextBlock Grid.Row="2" Style="{StaticResource ShareTitleFontStyle}"  Margin="0,60,0,0"  Text="Proyecto:" ></TextBlock>
            <ComboBox x:Name="ProjectsCombo" Grid.Row="2" Margin="120,60,0,0" HorizontalAlignment="Left" Width="140">
            
            </ComboBox>
            <Button x:Name="ShareButton" Grid.Row="2" Style="{StaticResource DefaultButtonStyle}" Margin="0,60,0,0" Content="Nueva Tarea" HorizontalAlignment="Right" Click="ShareButton_Click"/>
        </Grid>

    </Grid>
</UserControl>
